<template>
    <view class="content">
        <u-form>
            <u-form-item label="地址" prop="address" @click="addressShow = true;">
                <u--input v-model="address" disabled disabledColor="#ffffff" border="none"
                    placeholder='请输入家庭地址'></u--input>
            </u-form-item>
        </u-form>
        <address-picker :show="addressShow" closeOnClickOverlay @confirm='confirmAddress' @cancel='addressShow=false'
            @close='addressShow = false' :address-data="addressData" :indexs="indexs" :areaId="areaId" :type="type"></address-picker>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                address: '',
                addressShow: false,
                indexs: [0, 0, 0],
                areaId: [1, 110000, 110101],
                addressData: ['北京市', '北京市', '东城区'],
                type: 3, //1-省，2-省市，3-省市区
            }
        },
        
        methods: {
            confirmAddress(val) {
                console.log(val);
                this.address = val.value.join('')
                this.addressShow = false
            }
        }
    }
</script>

<style>

</style>
